import type { ListDataI, ListParams } from '@/types'
import type { PoleAreaI, PoleI, PoleWarningI } from '@/types/rod'
import { http } from '@/utils/reuqest'

/**
 * 查看一体杆列表
 */
export const poleGetListApi = (params: ListParams) =>
  http.get<ListDataI<PoleI>>('pole/info/list', params)
/**
 * 添加一体杆
 */
export const poleAddApi = (data: PoleI) => http.post('pole/info', data)
/**
 * 编辑一体杆
 */
export const poleEditApi = (data: PoleI) => http.put('pole/info', data)
/**
 * 删除一体杆
 */
export const poleDelApi = (ids: string) => http.delete(`pole/info/${ids}`)
/**
 * 获取关联区域下拉列表
 */
export const poleGetAreaListApi = () =>
  http.get<PoleAreaI[]>('parking/area/dropList')
/**
 * 查看告警记录列表
 */
export const poleWarningGetListAPi = (params: ListParams) =>
  http.get<ListDataI<PoleWarningI>>('pole/warning/list', params)
/**
 * 查看告警详情
 */
export const poleWarningViewApi = (id: number) =>
  http.get<PoleWarningI>(`pole/warning/${id}`)
/**
 * 删除告警记录
 */
export const poleWarningDelApi = (id: number) =>
  http.delete<null>(`pole/warning/${id}`)
